package com.cssw.fyzb.web.controller;


import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.web.service.CmfUsersVideoService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.Null;
import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: zzf
 * @Date: 2020/12/4 09:53
 * @Description:
 */
@ApiModel("短视频相关接口")
@RestController
@RequestMapping("/cmfUsersVideo")
public class CmfUsersVideoController {

    @Autowired
    private CmfUsersVideoService cmfUsersVideoService;

    @ApiOperation(value = "短视频查询", response = AjaxPage.class)
    @GetMapping (value = "/list")
    public AjaxPage list(int page, int limit, String nickName, String title, String auditStatus) {
        Map param = new HashMap();
        param.put("nickName", nickName);
        param.put("title", title);
        param.put("auditStatus", auditStatus);
        return cmfUsersVideoService.list(page, limit, param);
    }

    @ApiOperation(value = "审核", response = AjaxData.class)
    @PostMapping(value = "/audit")
    public AjaxData audit(@RequestBody Map<String,Long> param) {
        return cmfUsersVideoService.audit(param.get("videoId"));
    }

    @ApiOperation(value = "驳回", response = AjaxData.class)
    @PostMapping(value = "/reject")
    public AjaxData reject(@RequestBody Map<String,Long> param) {
        return cmfUsersVideoService.reject(param.get("videoId"));
    }
}
